<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
  <title>选择结构示例</title>
</head>
<body>
  <div id="result"></div>

  <script>
    // 定义一个变量age
    var age = 25;
    var resultDiv = document.getElementById("result");
    var resultText = "";

    // 判断条件并构建结果字符串
    resultText += "age变量的值为: " + age + "<br>";

    if (age >= 20) {
      resultText += "age>=20 : true<br>";
    } else {
      resultText += "age>=20 : false<br>";
    }

    if (age < 20) {
      resultText += "age<20 : true<br>";
    } else {
      resultText += "age<20 : false<br>";
    }

    if (age !== 20) {
      resultText += "age!=20 : true<br>";
    } else {
      resultText += "age!=20 : false<br>";
    }

    if (age > 20) {
      resultText += "age>20 : true<br>";
    } else {
      resultText += "age>20 : false<br>";
    }

    // 将结果显示在页面上
    resultDiv.innerHTML = resultText;
  </script>
</body>
</html>
